using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Crossborder.Common.Utility.HttpHelper
{
    public static class HttpHelper
    {
        public static HttpResponsion Success()
        {
            return new HttpResponsion
            {
                Code = 0,
                Data = null,
                Message = "操作成功。",
                Error = string.Empty
            };
        }

        public static HttpResponsion Success(dynamic data)
        {
            return new HttpResponsion
            {
                Code = 0,
                Data = data,
                Message = "操作成功。",
                Error = string.Empty
            };
        }

        public static HttpResponsion Success(string message, dynamic? data = null)
        {
            return new HttpResponsion
            {
                Code = 0,
                Data = data,
                Message = message,
                Error = string.Empty
            };
        }

        public static HttpResponsion Fail(string message)
        {
            return new HttpResponsion
            {
                Code = -1,
                Data = null,
                Message = message,
                Error = message
            };
        }
    }
}